<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/8/14
 * Time: 17:06
 */

namespace Common\Model;
use Think\Model;
class EmployeeModel extends BaseModel {

    public function queryForList($page=null, $map=null) {
        $list = $this->alias("emp")
            ->join("left join __CUSTOMER__ cus on cus.customer_id = emp.customer_id")
            ->where(getWhereSqlByMap($map))
            ->order("emp.create_time desc")
            ->limit($page->firstRow . ',' . $page->listRows)
            ->field("emp.*,cus.nickname")
            ->select();

        return $list;

    }

}

